package com.starblink.utils.app.interceptor

import com.apollographql.apollo3.api.ApolloRequest
import com.apollographql.apollo3.api.ApolloResponse
import com.apollographql.apollo3.api.Error
import com.apollographql.apollo3.api.Operation
import com.apollographql.apollo3.interceptor.ApolloInterceptor
import com.apollographql.apollo3.interceptor.ApolloInterceptorChain
import com.starblink.utils.log.SKLogger
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.onEach

class ErrorApolloInterceptor : ApolloInterceptor {

    override fun <D : Operation.Data> intercept(
        request: ApolloRequest<D>,
        chain: ApolloInterceptorChain
    ): Flow<ApolloResponse<D>> {
        return chain.proceed(request).onEach {
            SKLogger.d("ErrorApolloInterceptor","----进入拦截器----")
        }

    }
}